package com.tz.springmvc.framework.converter;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

import org.springframework.core.convert.converter.Converter;

/**
 * 日期格式的转换
 * @author Administrator
 *
 */
public class DateFormatterConvert implements Converter<String,Date>{
	@Override
	public Date convert(String source) {
		 try {
			 SimpleDateFormat simpleDateFormat =
					 	new SimpleDateFormat("yyy-MM-dd");
			return  simpleDateFormat.parse(source);
		} catch (ParseException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		return null;
	}

}
